-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement repo priorities. #112
Conversation
Drop the redundant NeedsInstallation check from install.FromRepo. In all calls of FromRepo, prior checks have already been performed and this extra check breaks priority rollbacks.
goolib/goospec_test.go
Outdated
v2 string | ||
want int | ||
}{ | ||
{500, "1.2.3@1", 500, "1.2.3@2", -1}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add a short description to each test case and print that when "got != tc.want"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
PTAL |
Can you rebase with the new repo changes (should be minor) |
Done. Sorry for the long delay, have been out on leave. Thanks for the review! |
If the already installed version is the exact same as the version available in a higher priority repo, then there is no reason to reinstall that version. Also added tests for the updates code.
PTAL: changed the updates logic to prevent unnecessary reinstalls and added some tests. |
This adds an integer priority value to repo entries in repo config files. If not specified, a default priority of 500 is used.
These priorities are associated with package versions in the map returned by client.AvailableVersions. When looking for the latest version, client.FindRepoLatest takes priorities into account such that a package version from a higher priority repo will always compare greater than any package version from a lower priority repo.
During "googet install" the highest priority version will be installed if the package is not already installed, otherwise the install logic remains the same if the package is already installed.
During "googet update" versions with priority greater than the default priority of 500 will take precedence over installed versions. The highest priority version will be installed even if it means downgrading the installed version in order to facilitate rollbacks.